package com.headStorm.factory;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

public class FFPmeg {


        public static void main(String[] args) {
            String cmd="ffmpeg -re -i /usr/local/nginx/html/record/c-2020-07-09-15_12_39.mp4 -c copy -f flv rtmp://192.168.126.128:1935/live/a";
            try {
                Process process = Runtime.getRuntime().exec(cmd);
                InputStream is = process.getInputStream();
                InputStreamReader isr = new InputStreamReader(is);
                BufferedReader br = new BufferedReader(isr);
                String content = br.readLine();
                while (content != null) {
                    System.out.println(content);
                    content = br.readLine();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
}
